<?php /*a:3:{s:65:"D:\ROOTWWW\myCeshi\tpVue\app\admin\view\admin\admin_log\index.php";i:1595935156;s:57:"D:\ROOTWWW\myCeshi\tpVue\app\admin\view\public\header.php";i:1599018492;s:57:"D:\ROOTWWW\myCeshi\tpVue\app\admin\view\public\footer.php";i:1594462056;}*/ ?>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>操作日志 - 派后台管理系统</title>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="icon" href="/system/admin/favicon.ico" type="image/ico">
<meta name="keywords" content="H-后台管理系统">
<title>首页 - <?php echo systemConfig("title"); ?></title>
<meta name="description" content="H-后台管理系统">
<meta name="author" content="cfn">
<script src="/system/admin/js/jquery.min.js"></script>
<link href="/system/admin/css/bootstrap.min.css" rel="stylesheet">
<link href="/system/admin/css/materialdesignicons.min.css" rel="stylesheet">
<link href="/system/admin/css/animate.css" rel="stylesheet">
<link href="/system/admin/css/style.min.css" rel="stylesheet">
<link href="/system/admin/js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link rel="stylesheet" href="/system/admin/js/jconfirm/jquery-confirm.min.css">
<link rel="stylesheet" href="/system/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css">
<style>
    .form-inline .form-group label{
        padding: 0 10px;
    }
    .form-inline .form-group{
        margin-bottom: 10px !important;
    }
</style>
</head>
<body>
<div class="container-fluid p-t-15">
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header"><h4>搜索</h4></div>
                <div class="card-body">
                    <form class="form-inline searchForm">
                        <div class="form-group">
                            <label for="name">操作人</label>
                            <div class="input-group">
                                <div class="input-group">
                                    <input type="text" class="form-control" id="name" value="<?php echo htmlentities($where['name']); ?>" name="name" placeholder="请输入操作人名称，ID">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="ip">来访IP</label>
                            <div class="input-group">
                                <div class="input-group">
                                    <input type="text" class="form-control" id="ip" value="<?php echo htmlentities($where['ip']); ?>" name="ip" placeholder="IP地址">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="start_time">操作时间</label>
                            <div class="input-group">
                                <input class="form-control js-datetimepicker" type="text" id="start_time" name="start_time" value="<?php echo htmlentities($where['start_time']); ?>" data-side-by-side="true" data-locale="zh-cn" data-format="YYYY-MM-DD" placeholder="开始时间">
                                <span class="input-group-addon">~</span>
                                <input class="form-control js-datetimepicker" type="text" name="end_time" value="<?php echo htmlentities($where['end_time']); ?>" data-side-by-side="true" data-locale="zh-cn" data-format="YYYY-MM-DD" placeholder="结束时间">
                            </div>
                        </div>
                        <button type="submit" class="btn btn-success" style="margin: -10px 0 0 10px;" id="search">搜索</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-12">
            <div class="card">
                <div class="card-toolbar clearfix">
                    <div class="toolbar-btn-action">
                        <a class="btn btn-warning" href="#!" onclick="delSelect()"><i class="mdi mdi-window-close"></i> 删除</a>
                        <a class="btn btn-danger" href="#!" onclick="delAll()"><i class="mdi mdi-window-close"></i> 全部删除</a>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th class="text-center">
                                    <label class="lyear-checkbox checkbox-primary">
                                        <input type="checkbox" id="check-all"><span></span>
                                    </label>
                                </th>
                                <th class="text-center">序号</th>
                                <th class="text-center">操作人</th>
                                <th class="text-center">操作名称</th>
                                <th class="text-center">IP</th>
                                <th class="text-center">User Agent</th>
                                <th class="text-center">操作时间</th>
                                <th class="text-center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>
                                <tr>
                                    <td class="text-center">
                                        <label class="lyear-checkbox checkbox-primary">
                                            <input type="checkbox" name="ids[]" value="<?php echo htmlentities($item['id']); ?>"><span></span>
                                        </label>
                                    </td>
                                    <td class="text-center"><?php echo htmlentities($item['id']); ?></td>
                                    <td class="text-center"><?php echo htmlentities($item['admin_name']); ?></td>
                                    <td class="text-center"><?php echo htmlentities($item['name']); ?></td>
                                    <td class="text-center"><?php echo htmlentities($item['ip']); ?></td>
                                    <td class="text-center"><?php echo htmlentities($item['user_agent']); ?></td>
                                    <td class="text-center"><?php echo htmlentities(date('Y-m-d H:i:s',!is_numeric($item['create_time'])? strtotime($item['create_time']) : $item['create_time'])); ?></td>
                                    <td class="text-center">
                                        <div class="btn-group">
                                            <a class="btn btn-xs btn-default" href="#!" title="删除" data-toggle="tooltip" onclick="delOne('<?php echo htmlentities($item['id']); ?>')"><i class="mdi mdi-window-close"></i></a>
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <?php echo $list; ?>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/system/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/system/admin/js/iframe.js"></script>
<script type="text/javascript" src="/system/admin/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap-table/bootstrap-table.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<link href="/system/admin/js/x-editable/1.5.1/bootstrap3-editable/css/bootstrap-editable.min.css" rel="stylesheet">
<script type="text/javascript" src="/system/admin/js/x-editable/1.5.1/bootstrap3-editable/js/bootstrap-editable.min.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap-table/extensions/editable/bootstrap-table-editable.min.js"></script>
<script src="/system/admin/js/jconfirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="/system/admin/js/main.min.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap-datetimepicker/moment.min.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>
<script type="text/javascript" src="/system/admin/js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="/system/admin/js/lightyear.js"></script>

<script type="text/javascript">
    Array.prototype.remove = function(val) {
        var index = this.indexOf(val);
        if (index > -1) {
            this.splice(index, 1);
        }
    };

    /**
     * @param fields
     * @returns {{}}
     */
    function toArrayList(fields) {
        var f = {};//声明一个对象
        $.each(fields,function(index,field){
            f[field.name] = field.value;
        });
        return f;
    }
</script>
<script type="text/javascript">
    function delOne(id) {
        $.confirm({
            title: '重要提醒!',
            content: '删除后将不可恢复，请谨慎操作!',
            backgroundDismiss: true,
            buttons: {
                ok: {
                    text: '确认',
                    btnClass: 'btn-danger',
                    action: function () {
                        $.post("/admin/admin.admin_log/del",data={id:id},function (res) {
                            if (res.status == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
                            else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
                            location.reload();
                        })
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-primary'
                }
            }
        });
    }
    function delAll() {
        $.confirm({
            title: '重要提醒!',
            content: '清空后将不可恢复，请谨慎操作!',
            backgroundDismiss: true,
            buttons: {
                ok: {
                    text: '确认',
                    btnClass: 'btn-danger',
                    action: function () {
                        $.post("/admin/admin.admin_log/empty",data={},function (res) {
                            if (res.status == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
                            else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
                            location.reload();
                        })
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-primary'
                }
            }
        });
    }

    function delSelect() {
        var checkID = "";
        $("input[name='ids[]']:checked").each(function(i){
            checkID += $(this).val()+",";
        });
        if (checkID=="") return lightyear.notify("没有选中项", 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
        $.confirm({
            title: '重要提醒!',
            content: '选中项删除后将不可恢复，请谨慎操作!',
            backgroundDismiss: true,
            buttons: {
                ok: {
                    text: '确认',
                    btnClass: 'btn-danger',
                    action: function () {
                        $.post("/admin/admin.admin_log/del",data={id:checkID},function (res) {
                            if (res.status == 200) { lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');location.reload();}
                            else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
                        })
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-primary'
                }
            }
        });
    }
</script>
</body>
</html>